#pragma once
#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
class Player {
public:
	Player();
	~Player();
	void Initialize(sf::RenderWindow* window);
	void Update();
	void Cleanup();
	void move(float xDir, float yDir);
	void resetPos()	{	m_playerSprite->setPosition(m_renderWindow->getSize().x/2, m_renderWindow->getSize().y);	};
	sf::Sprite* getSprite()	{	return m_playerSprite;	};
	sf::RectangleShape* getCollisionRect()	{	return m_collisionRect;	};
	sf::Clock* m_clock;
	sf::Sprite* m_playerSprite;
	int	getHP()	{	return m_hp;	};
	void	setHP(int hp)	{	m_hp = hp;	};
	int	getScore()	{	return m_score;	};
	void takeDamage(int dmg)	{	m_hp = m_hp - dmg;	};
	void addScore(int score)	{	m_score = m_score + score;	};
	void subScore(int score)	{	m_score = m_score - score;	};
	bool gameOver(){	if(m_hp <= 0){	return true;	}else{	return false;	}	};
	int m_score;

private:
	sf::Vector2f	m_lastPos;
	int m_hp;
	int m_lastHp;
	sf::Texture* m_playerTexture;
	sf::RenderWindow* m_renderWindow;
	sf::Time timeSinceLastFrame;
	sf::Sound* m_hurtSound;
	sf::SoundBuffer* m_hurtBuffer;
	sf::RectangleShape*	m_collisionRect;

};

